import service from "@/service";

//台账-列表
export function getLedgerList(data) {
  let { componentParts, completeStatus, beamType, page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/getReportList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data: {
      componentParts,
      completeStatus,
      beamType,
    },
  });
}

//查询导出框字段
export function getBoxFields(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/exportFields`,
    method: "GET",
    params,
  });
}

//台账-详情
export function getLedgerDetail(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/reportDetail?id=${id}`,
    method: "POST",
  });
}
//台账-编辑
export function editLedger(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/editReport?id=${id}`,
    method: "POST",
    data,
  });
}

//批量导出
export function exportLedgerData(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/exportReportData`,
    method: "POST",
    apiType: "file",
    responseType: "arraybuffer",
    method: "POST",
    data,
  });
}
